<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>专家信息库管理</title>
    <%@ include file="../common/meta.jsp" %>
    <%@ include file="../common/common-body.jsp" %>
    <link href="${ctx}/css/page/common-list.css?t=${now}" rel="stylesheet">
    <link href="${ctx}/css/page/common-search.css?t=${now}" rel="stylesheet">
    <script src="${ctx}/js/imageview/jquery.photo.gallery.js?t=${now}"></script>
</head>
<script>
    var searchInfo = '${searchInfo}';
    var mergeMap = '${mergeMap}';
    var checkTypeMap = '${checkTypeMap}';
    var checkResultTypeMap = '${checkResultTypeMap}';
    var dataStatusMap = '${dataStatusMap}';
    var publishStatusMap = '${publishStatusMap}';
    var checkBizTypeMap = '${checkBizTypeMap}';
    var mediLevelList = '${mediLevelList}';
</script>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5><i class="fa fa-search"></i> 筛选查询</h5>
                </div>
                <div class="ibox-content ibox-content-search">
                    <form class="form-horizontal m-t" id="searchForm" novalidate="novalidate"
                          action="${ctx}/pfUser/getGridData" target="formIframeName" method="post">
                        <div class="form-group">
                            <label class="col-sm-1 control-label">查询专家：</label>
                            <div class="col-sm-5">
                                <input type="text" name="docName" id="docName" class="form-control" value="${not empty searchInfo ? searchInfo.docName : ''}"
                                       onkeydown="if(event.keyCode==13){doRefresh();return false;}"
                                       placeholder="输入专家姓名" maxlength="8">
                            </div>
                            <label class="col-sm-1 control-label">数据来源：</label>
                            <div class="col-sm-2">
                                <div class="input-group">
                                    <input class="hideItem" id="isvPid" value="${not empty searchInfo ? searchInfo.isvPid : ''}" name="isvPid">
                                    <input type="text" id="isvPidName" placeholder="输入数据来源" value="${not empty searchInfo ? searchInfo.isvName : ''}" name="isvName" class="form-control" maxlength="20">
                                    <div class="input-group-btn">
                                        <button type="button" class="btn btn-default dropdown-toggle mySearchBtn" data-toggle="dropdown">
                                            <span class="caret"></span>
                                        </button>
                                        <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <div class="ibox-tools ibox-tools-search">
                                <button type="button" class="btn btn-primary btn-outline" onclick="doRefresh()">查询 </button>
                                <button type="button" class="btn btn-primary btn-outline" onclick="clearFrom('searchForm')">重置</button>
                                <button type="button" class="btn btn-primary btn-outline" onclick="openSearchTools();"><i class="fa fa-caret-down"></i></button>
                            </div>
                        </div>
                        <div class="search-tools">
                            <div class="form-group">
                                <label class="col-sm-1 control-label">发布状态：</label>
                                <div class="col-sm-2">
                                    <select class="form-control" name="status" id="status"
                                            onchange="doRefresh()">
                                        <option value="">--请选择--</option>
                                        <c:forEach items="${publishStatusMap}" var="item">
                                            <option value="${item.key}" ${not empty searchInfo && searchInfo.status == item.key ? 'selected' : '' } >${item.value}</option>
                                        </c:forEach>
                                    </select>
                                </div>
                                <label class="col-sm-1 control-label">数据状态：</label>
                                <div class="col-sm-2">
                                    <select class="form-control" name="dataStatus" id="dataStatus" onchange="doRefresh()">
                                        <option value="">--请选择--</option>
                                        <c:forEach items="${dataStatusMap}" var="item">
                                            <option value="${item.key}" ${not empty searchInfo && searchInfo.dataStatus == item.key ? 'selected' : '' } >${item.value}</option>
                                        </c:forEach>
                                    </select>
                                </div>
                                <label class="col-sm-1 control-label">专家职称：</label>
                                <div class="col-sm-2">
                                    <select class="form-control" name="docMediLevel" id="docMediLevel" onchange="doRefresh()">
                                        <option value="">--请选择--</option>
                                        <c:if test="${not empty mediLevelList}">
                                            <c:forEach items="${mediLevelList}" var="item">
                                                <option value="${item.dictCode}" ${not empty searchInfo && searchInfo.docMediLevel == item.dictCode ? 'selected' : '' }>${item.dictName}</option>
                                            </c:forEach>
                                        </c:if>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                    <label class="col-sm-1 control-label">一级科室：</label>
                                    <div class="col-sm-2">
                                        <div class="input-group">
                                            <input class="hideItem" id="pDeptCode" value="${not empty searchInfo ? searchInfo.pDeptCode : ''}" name="pDeptCode">
                                            <input type="text" id="pDeptName" placeholder="输入一级科室" name="pDeptName" value="${not empty searchInfo ? searchInfo.pDeptName : ''}" class="form-control" maxlength="20">
                                            <div class="input-group-btn">
                                                <button type="button" class="btn btn-default dropdown-toggle mySearchBtn" data-toggle="dropdown">
                                                    <span class="caret"></span>
                                                </button>
                                                <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                                    <label class="col-sm-1 control-label">二级科室：</label>
                                    <div class="col-sm-2">
                                        <div class="input-group">
                                            <input class="hideItem" id="cDeptCode" value="${not empty searchInfo ? searchInfo.cDeptCode : ''}" name="cDeptCode">
                                            <input type="text" id="cDeptName" placeholder="输入二级科室" value="${not empty searchInfo ? searchInfo.cDeptName : ''}" name="cDeptName" class="form-control" maxlength="20">
                                            <div class="input-group-btn">
                                                <button type="button" class="btn btn-default dropdown-toggle mySearchBtn" data-toggle="dropdown">
                                                    <span class="caret"></span>
                                                </button>
                                                <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                                    <label class="col-sm-1 control-label">执业医院：</label>
                                    <div class="col-sm-2">
                                        <div class="input-group">
                                            <input class="hideItem" id="orgCode" value="${not empty searchInfo ? searchInfo.orgCode : ''}" name="orgCode">
                                            <input type="text" id="orgName" placeholder="输入执业医院" value="${not empty searchInfo ? searchInfo.orgName : ''}" name="orgName" class="form-control" maxlength="20">
                                            <div class="input-group-btn">
                                                <button type="button" class="btn btn-default dropdown-toggle mySearchBtn" data-toggle="dropdown">
                                                    <span class="caret"></span>
                                                </button>
                                                <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">合并状态：</label>
                                <div class="col-sm-2">
                                    <select class="form-control" name="isMerge" id="isMerge"
                                            onchange="doRefresh()">
                                        <option value="">--请选择--</option>
                                        <c:forEach items="${mergeMap}" var="item">
                                            <option value="${item.key}" ${not empty searchInfo && searchInfo.isMerge == item.key ? 'selected' : '' } >${item.value}</option>
                                        </c:forEach>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5><i class="fa fa-table"></i> 专家信息</h5>
                    <div class="ibox-tools col-sm-offset-4">
                        <c:if test="${userType == 'super' || not empty btnMap['addDoc']}">
                            <button class="btn btn-primary btn-outline" onclick="openEditPage('add')">新建</button>
                        </c:if>
                        <c:if test="${userType == 'super' || not empty btnMap['editDoc']}">
                            <button class="btn btn-primary btn-outline" onclick="openEditPage('edit')">编辑</button>
                        </c:if>
                        <c:if test="${userType == 'super' || not empty btnMap['commitDoc']}">
                            <button class="btn btn-primary btn-outline" onclick="doCommit()">提交发布</button>
                        </c:if>
                        <c:if test="${userType == 'super' || not empty btnMap['revokeDoc']}">
                            <button class="btn btn-primary btn-outline" onclick="checkDocRevoke()">撤销发布</button>
                        </c:if>
                        <c:if test="${userType == 'super' || not empty btnMap['delDoc']}">
                            <button class="btn btn-primary btn-outline" onclick="checkDocDelete()">删除</button>
                        </c:if>
                        <c:if test="${userType == 'super' || not empty btnMap['exportDoc']}">
                            <button class="btn btn-primary btn-outline" onclick="doExport()">导出</button>
                        </c:if>
                        <%--<button class="btn btn-primary btn-outline" onclick="batchUpdate('freeze')">导入</button>--%>
                        <button class="btn btn-primary btn-outline" onclick="doRefresh()">刷新</button>
                    </div>
                </div>
                <div class="ibox-content ibox-content-table">
                    <iframe id="formIframe" name="formIframeName" style="display:none;"></iframe>
                    <table data-toggle="table" id="dataTable" data-height="320"
                           data-pagination="true" data-side-pagination="server" data-striped="true"
                           data-url="${ctx}/basicDoctorInfo/pageFindBasicDoctorInfoData?t=${now}" data-response-handler="handleServerResult"
                           data-query-params-type="" data-query-params="getParams"
                           data-page-number="${not empty searchInfo.pageNo ? searchInfo.pageNo : 1}"
                           data-page-size="${not empty searchInfo.pageSize ? searchInfo.pageSize : defaultPageSize}"
                           data-cache="false" data-page-list="${pageList}">
                        <thead>
                        <tr>
                            <%--<th data-field="checkBx" data-checkbox="true"></th>--%>
                            <th data-field="isvPid" data-visible="false">isvPid</th>
                            <th data-field="docCode" data-width="250px" data-align="center">专家编码</th>
                            <th data-field="status" data-formatter="formatPublishStatus" data-width="70px" data-align="center">发布状态</th>
                            <th data-field="dataStatus" data-formatter="formatDataStatus" data-width="70px" data-align="center">数据状态</th>
                            <th data-field="docLogo" data-formatter="img" data-width="70px" data-align="center">专家头像</th>
                            <th data-field="docName" data-width="100px" data-formatter="formatName" data-align="center" data-events="actionEvents">专家名称</th>
                            <th data-field="code" data-width="120px" data-align="center">原专家编码</th>
                            <th data-field="isvName" data-width="100px" data-formatter="formatIsv" data-events="actionEvents" data-align="center">数据来源</th>
                            <th data-field="docMergeCode" data-width="250px" data-align="center">合并专家编码</th>
                            <th data-field="sortNum" data-width="50px" data-align="center">排序</th>
                            <th data-field="creator" data-formatter="formatterCreator" data-width="100px" data-align="center">创建人</th>
                            <th data-field="operator" data-formatter="formatterOperator" data-width="100px" data-align="center">编辑人</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5><i class="fa fa-table"></i> 操作记录</h5>
                </div>
                <div class="ibox-content ibox-content-table">
                    <table data-toggle="table" id="dataTable2"  data-height="320"
                           data-pagination="true" data-side-pagination="server" data-striped="true"
                           data-url="" data-response-handler="handleServerResult"
                           <%--data-url="${ctx}/basicDoctorInfo/pageFindBasicDocInfoCheckLogData?t=${now}" data-response-handler="handleServerResult"--%>
                           data-query-params-type="" data-query-params="getParams"
                           data-cache="true" data-page-size="${defaultPageSize}" data-page-list="${pageList}">
                        <thead>
                        <tr>
                            <th data-field="checkType" data-formatter="formatCheckType" data-width="80px" data-align="center">变更类型</th>
                            <th data-field="gmtPublish" data-width="80px" data-align="center">提交时间</th>
                            <th data-field="operatorCommit" data-width="80px" data-align="center">提交人</th>
                            <th data-field="remark" data-width="80px">说明</th>
                            <th data-field="gmtCreate" data-width="80px" data-align="center">审核时间</th>
                            <th data-field="operator" data-width="100px" data-align="center">审核人</th>
                            <th data-field="result" data-width="100px" data-formatter="formatCheckResultType" data-align="center">审核结果</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="text-center">${companyName}</div>
        </div>
    </div>
</div>

<div id="setReasonPage" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 id="_modelTitle" style="text-align: center; font-weight: normal;">撤销发布</h4>
            </div>
            <div class="modal-body modal-body-height">
                <form class="form-horizontal m-t" id="_tipForm">
                    <div class="form-group">
                        <label class="col-sm-12 control-label" style="text-align: left;"><span style="color: red">*</span>请输入撤销发布原因：</label>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-12">
                            <c:forEach items="${reasonList}" var="item">
                                <label class="reasonCheckLabel"><input type="checkbox" name="_reason" value="${item.dictName}">${item.dictName}</label>
                            </c:forEach>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-12">
                            <textarea id="reason" name="reason" style="height: 100px; resize: none; width: 100%;"></textarea>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button class="btn btn-primary" onclick="doSaveReason()">保存</button>
                <button class="btn btn-white" onclick="closeSetReasonPage();">返回</button>
            </div>
        </div>
    </div>
</div>
<script src="${ctx}/js/doctor/basicDoctorInfoMgr.js?t=${now}"></script>
</body>
</html>

